<!-- 表格 -->
<el-table :data="rootData" style="width: 100%" row-key="id" :tree-props="{ children: 'departmentList' }"
ref="tableRef">
<el-table-column prop="name" label="部门名称" width="250" />
<el-table-column prop="index" label="排序" width="100" />
<el-table-column prop="create_time" label="创建时间" width="280" />
<el-table-column prop="status" label="状态" :formatter="formatStatus" width="150" />
<el-table-column fixed="right" label="操作">

  <template #default="scope">
    <div class="operation-buttons">
      <!-- 检查是否为根节点，根节点只有 id 为 0 -->
      <el-button v-if="scope.row.id !== 0" type="primary" link size="small"
        @click="editMeetings(scope.$index, scope.row)" :icon="EditPen">修改</el-button>
      <!-- 根节点不显示删除按钮 && !scope.row.departmentList-->
      <el-button v-if="scope.row.id !== 0 && !scope.row.departmentList" type="primary" link size="small"
        :icon="Delete" @click="deleteDepartment(scope.$index, scope.row)">删除</el-button>
      <!-- 只在公司级别显示新增按钮，假设只有公司有 departmentList -->
      <el-button v-if="scope.row.departmentList" type="primary" link size="small"
        @click="addDepartment(scope.$index, scope.row)" :icon="Plus">新增</el-button>
    </div>
  </template>
</el-table-column>

</el-table>